package com.xujl.mvcbind.ui.list.model;

import com.xujl.fastlib.base.BaseModel;
import com.xujl.fastlib.base.IControl;
import com.xujl.mvcbind.bean.ListBean;

import java.util.ArrayList;
import java.util.List;


/**
 * <pre>
 *     author : xujl
 *     e-mail : 597355068@qq.com
 *     time   : 2019/08/20
 *     desc   :
 *     version: 1.0
 * </pre>
 */

public class GridListFragmentModel extends BaseModel {
    private List<ListBean> mBeanList = new ArrayList<>();

    @Override
    public void init (IControl control) {
        for (int i = 0; i < 30; i++) {
            mBeanList.add(new ListBean("item:" + i));
        }
    }

    public List<ListBean> getBeanList () {
        return mBeanList;
    }

    public void setCheckedData (int position) {
        for (int i = 0; i < mBeanList.size(); i++) {
            mBeanList.get(i).setChecked(i == position);
        }
    }
}
